package com.qf.api.fallback;

import com.qf.api.dto.PointDTO;
import com.qf.api.point.PointFeignService;
import com.qf.common.core.common.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * --- 缘分让我们相遇乱世以外 ---
 *
 * @author SJY
 * 2025/1/4
 */
@Component
public class PointFeignFallback implements FallbackFactory<PointFeignService> {
    @Override
    public PointFeignService create(Throwable cause) {
        return new PointFeignService() {
            @Override
            public R remoteAddPoint(PointDTO pointDTO) {
                return R.fail("远程添加积分失败");
            }

            @Override
            public R selPointRule(PointDTO pointDTO) {
                return R.fail("规则添加积分失败");
            }
        };
    }
}
